package com.goktech.sportsmall.controller;

import com.goktech.sportsmall.bean.OrdersBean;
import com.goktech.sportsmall.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("orders")
public class VueOrdersController {
    @Autowired
    private OrdersService ordersService;

    @GetMapping("insertOrder")
    public OrdersBean insertOrder(int u_id, int a_id, String a_phone, String a_address, String a_user){
        return ordersService.insertOrder(u_id,a_id,a_phone,a_address,a_user);

    }

    @GetMapping("selectByUid")
    public Map<String,Object> selectByUid(int u_id){
        return ordersService.selectByUid(u_id);
    }
}
